/*
 * @Author: Y先森
 * @Date: 2023-04-11 13:59:29
 * @LastEditors: y && 250048395@qq.com
 * @LastEditTime: 2023-05-10 16:56:31
 * @FilePath: \y-website\src\y-blog\main.js
 */
import { createApp } from 'vue'
import { useREM } from './utils/flexible'
import './styles/index.scss'
import App from './App.vue'
import router from './router'
import store from './store'
import useTheme from './utils/theme.js'

console.log('import.meta.env==>',import.meta.env)
console.log(import.meta.env.VITE_SOME_KEY)
// 引入指令
import Ylazy from './directives'

// 引入数字滚动插件
import countTo from 'vue3-count-to';

// 引入组件插件
import mLibs from './libs'

// 引入element-plus库
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/dark/css-vars.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

import 'virtual:svg-icons-register'

// 初始化主题
useTheme()

// 设置 rem
useREM()
app.use(store).use(router).use(ElementPlus).use(countTo).use(mLibs).use(Ylazy).mount('#app')
